<?php
require $_SERVER['DOCUMENT_ROOT'].'/../_core/common.php';

//权限验证
if( Role::init() == false ){
	exit('没有权限');
}

require $_SERVER['DOCUMENT_ROOT'].'/../_interface/name.php';

$db = new DB();

//查询列表
$analytic_codes_sql = 'select id,title,orders,edit_uid,updated from analytic_codes where is_del=1 order by orders desc,id asc';
$analytic_codes_rs = $db->query($analytic_codes_sql)->getAll();

//查询姓名
$db = new DB('news');
foreach( $analytic_codes_rs as $key=>$val ){
	$update_username = Name::get_username($db, $val['edit_uid']);
	$analytic_codes_rs[$key]['update_username'] = $update_username;
}

require template('admin/analytic_code/code_lists');